package com.d3works.apps.account.service;

import com.d3works.apps.account.db.AccountingSituation;
import com.d3works.apps.base.db.Company;
import com.d3works.apps.base.db.Partner;
import com.d3works.exception.D3worksException;
import java.util.List;

public interface AccountingSituationInitService {

  /**
   * Creates unexisting accounting situations for a given partner. Created situations will be
   * appended to the partner's AccountingSituationList
   *
   * @param partner Partner to create accounting situation for.
   * @return The created accounting situations (which is the same as calling
   *     partner.getAccountingSituationList())
   * @throws D3worksException In case of configuration issue
   */
  List<AccountingSituation> createAccountingSituation(Partner partner) throws D3worksException;

  AccountingSituation createAccountingSituation(Partner partner, Company company)
      throws D3worksException;

  /**
   * Automatically creates supplier/customer/employee accounts based on situation's company
   * configuration.
   *
   * @param situation Situation on which accounts should be created.
   */
  void createPartnerAccounts(AccountingSituation situation) throws D3worksException;
}
